<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sijyp="http://java.sun.com/jsf/composite/sijyp"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	template="/templates/template.xhtml">
	<ui:define name="body">
		<h:form id="entregaBienesForm" prependId="false">
			<h:panelGrid width="100%">

				<rich:panel style="width=100%">
					<f:facet name="header">
        ${msg['entrega.bienes.bienesParaEntregar']}
        
        </f:facet>


					<rich:dataTable id="richTable5" var="record_"
						value="#{entregaBienesManager.dataModel}" rows="10"
						noDataLabel="${msg['general.registrosNoEncontrados']}"
						style="margin:0 auto; width: 100%;">
						<rich:column>
							<a4j:region>
								<h:selectBooleanCheckbox value="record_.seleccionado">
									<a4j:ajax event="change"
										listener="#{entregaBienesManager.adicionarALista(record_)}" />
								</h:selectBooleanCheckbox>
							</a4j:region>
						</rich:column>
						<ui:include src="/resources/sijyp/jpaColumn.xhtml">
							<ui:param name="bean" value="#{entregaBienesManager}" />
							<ui:param name="propertyTitle" value="entrega.bienes.id" />
							<ui:param name="explicitProperty" value="#{record_.idBien}" />
							<ui:param name="propertySort" value="idBien" />
							<ui:param name="propertyFilter" value="idBien" />
							<ui:param name="id" value="columnaOculta" />
							<ui:param name="componentRender" value="richTable5" />
						</ui:include>
						<ui:include src="/resources/sijyp/jpaColumn.xhtml">
							<ui:param name="bean" value="#{entregaBienesManager}" />
							<ui:param name="propertyTitle" value="entrega.bienes.nombreBien" />
							<ui:param name="explicitProperty" value="#{record_.nombre}" />
							<ui:param name="propertySort" value="nombre" />
							<ui:param name="propertyFilter" value="nombre" />
							<ui:param name="componentRender" value="richTable5" />
						</ui:include>
						<ui:include src="/resources/sijyp/jpaColumn.xhtml">
							<ui:param name="bean" value="#{entregaBienesManager}" />
							<ui:param name="propertyTitle" value="entrega.bienes.tipoBien" />
							<ui:param name="explicitProperty" value="#{record_.tipo}" />
							<ui:param name="propertySort" value="tipo" />
							<ui:param name="propertyFilter" value="tipo" />
							<ui:param name="componentRender" value="richTable5" />
						</ui:include>
						<ui:include src="/resources/sijyp/jpaColumn.xhtml">
							<ui:param name="bean" value="#{entregaBienesManager}" />
							<ui:param name="propertyTitle" value="entrega.bienes.claseBien" />
							<ui:param name="explicitProperty" value="#{record_.clase}" />
							<ui:param name="propertySort" value="clase" />
							<ui:param name="propertyFilter" value="clase" />
							<ui:param name="componentRender" value="richTable5" />
						</ui:include>
						<ui:include src="/resources/sijyp/jpaColumn.xhtml">
							<ui:param name="bean" value="#{entregaBienesManager}" />
							<ui:param name="propertyTitle" value="entrega.bienes.estado" />
							<ui:param name="explicitProperty" value="#{record_.etapa}" />
							<ui:param name="propertySort" value="etapa" />
							<ui:param name="propertyFilter" value="etapa" />
							<ui:param name="componentRender" value="richTable5" />
						</ui:include>
						<!-- <ui:include src="/resources/sijyp/jpaColumn.xhtml">
							<ui:param name="bean" value="#{entregaBienesManager}" />
							<ui:param name="propertyTitle" value="entrega.bienes.estado" />
							<ui:param name="explicitProperty" value="#{record_.origen}" />
							<ui:param name="propertySort" value="origen" />
							<ui:param name="propertyFilter" value="origen" />
							<ui:param name="componentRender" value="richTable5" />
						</ui:include> -->
						<rich:column>
							<f:facet name="header">
								<sijyp:sortTable title="${msg['general.tabla.accion']}"></sijyp:sortTable>
							</f:facet>
							<h:panelGrid columns="1" columnClasses="icon_space">

								<h:commandLink value="" immediate="true"
									action="#{entregaBienesManager.consultarBien()}">
									<h:graphicImage value="/resources/images/icons/ico_details.png"
										title="${msg['boton.consultar']}" />
									<f:setPropertyActionListener
										target="#{entregaBienesManager.bienTemporal}"
										value="#{record_}" />
								</h:commandLink>

							</h:panelGrid>
						</rich:column>
					</rich:dataTable>

					<br />



					<h:outputText value="${msg['entrega.bienes.actaEntrega']} " />

					<hr width="100%" />


					<!-- columnClasses="col1ConsultaBienes,col2ConsultaBienes,col3ConsultaBienes,col4ConsultaBienes,col5ConsultaBienes,col6ConsultaBienes" -->
					<h:panelGrid columns="6" width="100%">

						<h:panelGrid>
							<h:outputLabel value="${msg['entrega.bienes.fechaActa']}" />
						</h:panelGrid>
						<h:panelGrid>
							<rich:calendar id="fechaDeActa" datePattern="dd/MM/yyyy"
								defaultTime="00:00:00" boundaryDatesMode="hidden"
								required="true"
								value="#{entregaBienesManager.bienEnvioSiijyp.fchActa}"
								dayDisableFunction="deshabilitarDiaPosterior"
								dayClassFunction="obtenerEstiloDisabled"
								requiredMessage="${msg['general.requerido']}" />
							<h:message for="fechaDeActa" errorClass="validationErrorMessage"
								showSummary="false" />
						</h:panelGrid>

						<h:panelGrid>
							<h:outputLabel value="${msg['entrega.bienes.numeroActa']}" />
						</h:panelGrid>
						<h:panelGrid>
							<h:inputText id="numeroActa" maxlength="15"
								value="#{entregaBienesManager.bienEnvioSiijyp.numActa}"
								required="true" requiredMessage="${msg['general.requerido']}" />
							<h:message for="numeroActa" errorClass="validationErrorMessage"
								showSummary="false" />
						</h:panelGrid>

						<h:panelGrid>
							<h:outputLabel value="${msg['entrega.bienes.anexo']}" />
						</h:panelGrid>

						<rich:fileUpload id="anexoEntregaBienes_fileSijyp"
							fileUploadListener="#{entregaBienesManager.cargarAnexo()}"
							acceptedTypes="doc, xls, pdf, txt, png, jpg, tif, docx, xlsx, ppt, pptx, gif, jpeg"
							ontyperejected="alert('Sólo se permiten tipos de archivo .doc, .xls, .pdf, .txt, .png, .jpg, .tif, .docx, .xlsx, .ppt, .pptx, .gif y .jpeg');"
							maxFilesQuantity="1"
							addLabel="${msg['bienes.fileUpload.examinar']}" clearAllLabel=""
							deleteLabel="${msg['bienes.fileUpload.borrar']}"
							doneLabel="${msg['bienes.fileUpload.finalizado']}"
							listHeight="40px"
							uploadLabel="${msg['bienes.fileUpload.cargar']}"
							clearLabel="${msg['bienes.fileUpload.limpiar']}"
							sizeExceededLabel="${msg['bienes.fileUpload.excedeMaximo']}">
						</rich:fileUpload>
						<h:outputText value="" />
						<h:outputText value="" />
						<h:outputText value="" />
						<h:outputText value="" />
						<h:outputText value="" />
						<h:message for="anexoEntregaBienes_fileSijyp"
							errorClass="validationErrorMessage" showSummary="false" />
					</h:panelGrid>

					<h:panelGrid width="100%" columns="2" columnClasses="col16,col84">
						<h:panelGrid columns="2">
							<h:outputLabel value="${msg['entrega.bienes.descripcion']}"
								for="descripcionDocEntregaSiijyp" />
							<h:outputLabel value="*" />
						</h:panelGrid>
						<h:panelGrid width="100%">
							<h:inputTextarea id="descripcionDocEntregaSiijyp"
								style="width:100%" required="true"
								requiredMessage="${msg['general.requerido']}"
								styleClass="long count250"
								value="#{entregaBienesManager.bienEnvioSiijyp.descripcion}"
								rows="4">
								<f:validateLength maximum="250" />
							</h:inputTextarea>
							<h:message for="descripcionDocEntregaSiijyp"
								errorClass="validationErrorMessage" showSummary="false" />
						</h:panelGrid>
						<h:outputText value="" />
					</h:panelGrid>

					<h:panelGroup style="text-align:center;" layout="block">
						<h:commandButton value="${msg['entrega.bienes.boton.entregar']}"
							action="#{entregaBienesManager.entregarBienes()}">
							<f:ajax render="@form :sijypMessages richTable5"
								execute="@this entregaBienesForm :sijypMessages" />
						</h:commandButton>
						<!-- onclick="#{rich:component('popupEntregaB2')}.show()" -->
						<h:commandButton value="${msg['entrega.bienes.boton.cancelar']}"
							action="#{entregaBienesManager.cancelar()}">
							<f:ajax render="entregaBienesForm :sijypMessages richTable5"
								execute="@this" />
						</h:commandButton>
					</h:panelGroup>


				</rich:panel>

				<br />
				<rich:panel style="width=100%">
					<f:facet name="header">
        ${msg['entrega.bienes.bienesEntregados']}
        
        </f:facet>


					<rich:dataTable id="richTable6" var="record_"
						value="#{entregaPaqueteBienes.dataModel}" rows="10"
						noDataLabel="${msg['general.registrosNoEncontrados']}"
						style="margin:0 auto; width: 100%;">
						<ui:include src="/resources/sijyp/jpaColumn.xhtml">
							<ui:param name="bean" value="#{entregaPaqueteBienes}" />
							<ui:param name="propertyTitle"
								value="entrega.bienes.fechaEntregaInfo" />
							<ui:param name="explicitProperty" value="#{record_.fchEntrega}" />
							<ui:param name="propertySort" value="fchEntrega" />
							<ui:param name="propertyFilter" value="fchEntrega" />
							<ui:param name="fecha" value="true" />
							<ui:param name="componentRender" value="richTable6" />
						</ui:include>
						<ui:include src="/resources/sijyp/jpaColumn.xhtml">
							<ui:param name="bean" value="#{entregaPaqueteBienes}" />
							<ui:param name="propertyTitle" value="entrega.bienes.fechaActa" />
							<ui:param name="explicitProperty" value="#{record_.fchActa}" />
							<ui:param name="propertySort" value="fchActa" />
							<ui:param name="propertyFilter" value="fchActa" />
							<ui:param name="fecha" value="true" />
							<ui:param name="componentRender" value="richTable6" />
						</ui:include>
						<ui:include src="/resources/sijyp/jpaColumn.xhtml">
							<ui:param name="bean" value="#{entregaPaqueteBienes}" />
							<ui:param name="propertyTitle" value="entrega.bienes.numeroActa" />
							<ui:param name="explicitProperty" value="#{record_.numActa}" />
							<ui:param name="propertySort" value="numActa" />
							<ui:param name="propertyFilter" value="numActa" />
							<ui:param name="componentRender" value="richTable6" />
						</ui:include>
						<ui:include src="/resources/sijyp/jpaColumn.xhtml">
							<ui:param name="bean" value="#{entregaPaqueteBienes}" />
							<ui:param name="propertyTitle"
								value="entrega.bienes.numeroBienes" />
							<ui:param name="explicitProperty"
								value="#{record_.cantidadBienes}" />
							<ui:param name="propertySort" value="cantidadBienes" />
							<ui:param name="propertyFilter" value="cantidadBienes" />
							<ui:param name="componentRender" value="richTable6" />
						</ui:include>
						<rich:column>
							<f:facet name="header">
								<sijyp:sortTable title="${msg['general.tabla.accion']}"></sijyp:sortTable>
							</f:facet>
							<h:panelGrid columns="1" columnClasses="icon_space">

								<h:commandLink value="" immediate="true"
									action="#{reporteManager.crearReporte('reporte_bienes_entregados',record_.idEnvio)}">
									<h:graphicImage value="/resources/images/icons/ico_pdf.png"
										title="${msg['boton.consultar']}" />
								</h:commandLink>

							</h:panelGrid>
						</rich:column>
						<f:facet name="footer">
							<rich:dataScroller id="scroller" />
						</f:facet>
					</rich:dataTable>

				</rich:panel>

			</h:panelGrid>

			<rich:popupPanel id="popupEntrega" modal="true" autosized="false"
				left="100" top="100" height="600" width="800"
				onmaskclick="#{rich:component('popupEntrega')}.hide()">
				<f:facet name="header">
					<h:outputText value="Bien Entregado" />
				</f:facet>
				<f:facet name="controls">
					<h:outputLink value="#"
						onclick="#{rich:component('popupEntrega')}.hide(); return false;"
						style="color:white">
                X
            </h:outputLink>
				</f:facet>
				<rich:panel
					style="width: 600px !important; height: 500px !important">

					<h:inputTextarea
						style="width: 600px !important; height: 500px !important" />

				</rich:panel>
			</rich:popupPanel>

		</h:form>
	</ui:define>
</ui:composition>
